<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue-css</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="app" >
        <div v-bind:class="{ active: isActive }">
            hi Vue
        </div>
    </div>
    <script>
        var vm = new Vue({
            el:'#app',
            data:{
                isActive: true,
                color:'red'
            }
        })
    </script>
    <!-- 绑定class为active 块元素,当data里面的 值为true,显示颜色，否则显示白色 -->
    <style>
        
        .active{background:red;}
    </style>
    
</body>
</html>